import React from "react";
import "./groupon.css"
const Groupon = (props) => {
    let {cartAdd,groupon}=props
    return (
        <div className="groupon">
        <h3>万人团</h3>

        {
            groupon?groupon.map(item => (
                <div className="clearfix" key={item.id}>
                    <img src={item.img} alt="" className="fl" />
                    <ul className="fr">
                        <li>{item.goodsname}</li>
                        <li>
                            <span>￥{item.price}</span>
                            <span>￥{item.market_price}</span>
                        </li>
                        <li>
                            余量{item.count} 限购{item.limit_count}
                        </li>
                        <li><button onClick={()=>cartAdd(item.id)}>加购</button></li>
                    </ul>
                </div>
            )):null
        }

    </div>
    );
};

export default Groupon;
